﻿using CoachingOrganizer.ClientInfrastructure.Factories;
using CoachingOrganizer.ClientInfrastructure.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoachingOrganizer.ClientAdapters
{
    public abstract class ServicesFactoryBase : IServicesFactory
    {
        private readonly Lazy<ILocalStorageService> _localStorage;

        public ServicesFactoryBase()
        {
            _localStorage = new Lazy<ILocalStorageService>(() => CreateStorageService(), true);
        }

        public ILocalStorageService GetCurrentLocalStorageService()
        {
            return _localStorage.Value;
        }

        public abstract ILocalStorageService CreateStorageService();
    }
}
